package com.shensi.appCollect.service.impl;

import com.shensi.appCollect.service.WxTemplateParamsGeneral;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * @Auther: luosx
 * @Date: 2024/3/11 18:42
 * @Description:
 */
@Component("monthlyConsumptionReport")
public class CustomConsumptionReportParams implements WxTemplateParamsGeneral {
    @Override
    public void setWxTemplateContent(List<String> contents, Map<String, String> templateParams, Map<String, Map<String, String>> data) {
        if(contents.contains("商户名称")){
            data.put("thing10", Collections.singletonMap("value", templateParams.get("stationName")));
        }
        if (contents.contains("账单周期")) {
            data.put("time2", Collections.singletonMap("value", templateParams.get("date")));
        }
        if (contents.contains("上月消费")) {
            data.put("amount9", Collections.singletonMap("value", templateParams.get("amtTotal")));
        }
    }
}